package trefliq.EJB.entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 *
 * @author Eric
 */
@Entity
@NamedQueries( {
    @NamedQuery(name="findAllShowBizPeople", query="select s from ShowBizPeople s"),
    @NamedQuery(name="findShowBizPersonById", query="select s from ShowBizPeople s where s.id = :id"),
    @NamedQuery(name="findShowBizPersonByLastName", query="select s from ShowBizPeople s where s.lname = :lname"),
    @NamedQuery(name="findShowBizPersonByFirstName", query="select s from ShowBizPeople s where s.fname = :fname"),
    @NamedQuery(name="findShowBizPersonByName", query="select s from ShowBizPeople s where s.lname = :lname and s.fname = :fname")
})

public class ShowBizPeople implements Serializable {
    
    @Id
    @Basic(optional = false)
//    @NotNull
    @Column(name = "ID", nullable = false)
//    @GeneratedValue(strategy=GenerationType.TABLE, generator="SHOWBIZPEOPLE")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    @Column(nullable=false)
    private String fname;
    
    @Column(nullable=false)
    private String lname;
    
    public ShowBizPeople() {
    }
    
    public ShowBizPeople(Long id) {
        this.id = id;
    }
    
    public ShowBizPeople(Long id, String fname, String lname) {
        this.id = id;
        this.fname = fname;
        this.lname = lname;
    }
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getFname() {
        return fname;
    }
    
    public void setFname(String fname) {
        this.fname = fname;
    }
    
    public String getLname() {
        return lname;
    }
    
    public void setLname(String lname) {
        this.lname = lname;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShowBizPeople)) {
            return false;
        }
        ShowBizPeople other = (ShowBizPeople) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "trefliq.persistence.entity.ShowBizPeople[ fname=" + fname + " ] lname[" + lname +"]";
    }
}